/**
 * 
 */
package comp6231.project.testcases;

/**
 * @author dimitri.tiago
 * TC 2.3
 */
public class BuyTestCase23 
{
	/**
	 * @param args
	 */
	public static void main(String[] args) 
	{		
		CustomerClient cc1 = new CustomerClient("m11111", "b", 1119, 1);
		CustomerClient cc2 = new CustomerClient("t22222", "b", 1119, 1);
		CustomerClient cc3 = new CustomerClient("v33333", "b", 1119, 1);
		CustomerClient cc4 = new CustomerClient("m44444", "b", 1119, 1);
		
		Thread customerClient1 = new Thread(cc1);	// m11111 buys 4 times (first 3 will fail due to software error)
		Thread customerClient11 = new Thread(cc1);
		Thread customerClient12 = new Thread(cc1);
		Thread customerClient13 = new Thread(cc1);	
		Thread customerClient2 = new Thread(cc2);
		Thread customerClient3 = new Thread(cc3);
		Thread customerClient4 = new Thread(cc4);
		
		customerClient1.start();
		customerClient11.start();
		customerClient12.start();
		customerClient13.start();
		customerClient2.start();
		customerClient3.start();
		customerClient4.start();
		
		try 
		{
			customerClient1.join();
			customerClient11.join();
			customerClient12.join();
			customerClient13.join();
			customerClient2.join();
			customerClient3.join();
			customerClient4.join();
		} 
		catch (InterruptedException e) 
		{
			e.printStackTrace();
		}
		
		CustomerClient cc5 = new CustomerClient("m11111", "c", 1119, 0);
		Thread customerClient5 = new Thread(cc5);
		customerClient5.start();
	}
}
